#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n, x, sum = 0;
		cin>>n;
		while(n--)
		{
			cin>>x;
			sum += x;
		}
		if(t)
			cout<<sum<<endl<<endl;
		else
			cout<<sum;
	}
	return 0;
}

